home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / EmailViewer / FULL / EmailViewer.jar / EV.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-12-23  |  7.3 KB  |  271 lines

  1. import java.io.IOException;
  2. import javax.microedition.lcdui.ChoiceGroup;
  3. import javax.microedition.lcdui.Command;
  4. import javax.microedition.lcdui.CommandListener;
  5. import javax.microedition.lcdui.Display;
  6. import javax.microedition.lcdui.Displayable;
  7. import javax.microedition.lcdui.Form;
  8. import javax.microedition.lcdui.Image;
  9. import javax.microedition.lcdui.List;
  10. import javax.microedition.lcdui.TextField;
  11. import javax.microedition.midlet.MIDlet;
  12. import javax.microedition.rms.RecordComparator;
  13. import javax.microedition.rms.RecordEnumeration;
  14. import javax.microedition.rms.RecordFilter;
  15. import javax.microedition.rms.RecordStore;
  16.  
  17. // $FF: renamed from: EV
  18. public class class_0 extends MIDlet implements CommandListener {
  19.    // $FF: renamed from: l javax.microedition.lcdui.Form
  20.    private Form field_0 = new Form((String)null);
  21.    // $FF: renamed from: w javax.microedition.lcdui.List
  22.    public static List field_1;
  23.    // $FF: renamed from: B byte[]
  24.    private static byte[] field_2;
  25.    // $FF: renamed from: q boolean
  26.    private static boolean field_3;
  27.    // $FF: renamed from: F javax.microedition.lcdui.Form
  28.    private Form field_4;
  29.    // $FF: renamed from: a javax.microedition.lcdui.ChoiceGroup
  30.    private ChoiceGroup field_5;
  31.    // $FF: renamed from: s javax.microedition.lcdui.ChoiceGroup
  32.    private ChoiceGroup field_6;
  33.    // $FF: renamed from: i javax.microedition.lcdui.ChoiceGroup
  34.    private ChoiceGroup field_7;
  35.    // $FF: renamed from: y javax.microedition.lcdui.TextField
  36.    private TextField field_8;
  37.    // $FF: renamed from: D javax.microedition.rms.RecordStore
  38.    private static RecordStore field_9;
  39.    // $FF: renamed from: e javax.microedition.rms.RecordEnumeration
  40.    private static RecordEnumeration field_10;
  41.    // $FF: renamed from: c javax.microedition.lcdui.Display
  42.    public static Display field_11;
  43.    // $FF: renamed from: f javax.microedition.lcdui.Command
  44.    public static final Command field_12 = new Command("Back", 2, 4);
  45.    // $FF: renamed from: p javax.microedition.lcdui.Command
  46.    public static final Command field_13 = new Command("OK", 4, 1);
  47.    // $FF: renamed from: r javax.microedition.lcdui.Command
  48.    public static final Command field_14 = new Command("Exit", 7, 99);
  49.    // $FF: renamed from: j javax.microedition.lcdui.Command
  50.    public static final Command field_15 = new Command("Select", 1, 1);
  51.    // $FF: renamed from: o javax.microedition.lcdui.Command
  52.    public static final Command field_16 = new Command("Stop", 6, 1);
  53.    // $FF: renamed from: n javax.microedition.lcdui.Command
  54.    public static final Command field_17 = new Command("Add", 1, 100);
  55.    // $FF: renamed from: A javax.microedition.lcdui.Command
  56.    public static final Command field_18 = new Command("Send", 1, 100);
  57.    // $FF: renamed from: E javax.microedition.lcdui.Command
  58.    public static final Command field_19 = new Command("Main", 1, 100);
  59.    // $FF: renamed from: u javax.microedition.lcdui.Command
  60.    public static final Command field_20 = new Command("Done", 1, 100);
  61.    // $FF: renamed from: x javax.microedition.lcdui.Command
  62.    public static final Command field_21 = new Command("Open", 1, 101);
  63.    // $FF: renamed from: C javax.microedition.lcdui.Command
  64.    public static final Command field_22 = new Command("Delete", 1, 102);
  65.    // $FF: renamed from: m javax.microedition.lcdui.Command
  66.    public static final Command field_23 = new Command("Edit", 1, 100);
  67.    // $FF: renamed from: h javax.microedition.lcdui.Command
  68.    public static final Command field_24 = new Command("Reply", 1, 99);
  69.    // $FF: renamed from: t javax.microedition.lcdui.Command
  70.    public static final Command field_25 = new Command("Reply All", 1, 100);
  71.    // $FF: renamed from: k javax.microedition.lcdui.Command
  72.    public static final Command field_26 = new Command("Details", 1, 101);
  73.    // $FF: renamed from: d javax.microedition.lcdui.Command
  74.    public static final Command field_27 = new Command("Next", 1, 106);
  75.    // $FF: renamed from: v javax.microedition.lcdui.Command
  76.    public static final Command field_28 = new Command("Cc", 1, 107);
  77.    // $FF: renamed from: z javax.microedition.lcdui.Command
  78.    public static final Command field_29 = new Command("Bcc", 1, 108);
  79.    // $FF: renamed from: g javax.microedition.lcdui.Command
  80.    public static final Command field_30 = new Command("Messages", 1, 109);
  81.    // $FF: renamed from: b m
  82.    public static m field_31;
  83.  
  84.    public class_0() {
  85.       try {
  86.          this.field_0.append(Image.createImage("/r.png"));
  87.       } catch (IOException var2) {
  88.       }
  89.  
  90.       this.field_0.append("\nEmailViewer 1.2.1\nby Reqwireless");
  91.       this.field_0.addCommand(field_13);
  92.       this.field_0.setCommandListener(this);
  93.    }
  94.  
  95.    public void startApp() {
  96.       field_11 = Display.getDisplay(this);
  97.       if (field_31 == null) {
  98.          field_31 = new m();
  99.       }
  100.  
  101.       field_2 = new byte[4];
  102.       field_3 = false;
  103.       if (field_1 == null) {
  104.          field_1 = new List("Main", 3);
  105.          field_1.addCommand(field_14);
  106.          field_1.addCommand(field_15);
  107.          field_1.setCommandListener(this);
  108.          field_1.append("Receive", (Image)null);
  109.          field_1.append("Send", (Image)null);
  110.          field_1.append("My Accounts", (Image)null);
  111.          field_1.append("Contacts", (Image)null);
  112.          field_1.append("About", (Image)null);
  113.          field_1.append("User's Guide", (Image)null);
  114.          field_1.append("Settings", (Image)null);
  115.          if (!m.ab) {
  116.             field_1.append("Register", (Image)null);
  117.          }
  118.       }
  119.  
  120.       if (field_11.getCurrent() == null) {
  121.          if (this.field_0 != null) {
  122.             field_11.setCurrent(this.field_0);
  123.             this.field_0 = null;
  124.          } else {
  125.             field_11.setCurrent(field_1);
  126.          }
  127.       }
  128.  
  129.    }
  130.  
  131.    public void pauseApp() {
  132.    }
  133.  
  134.    public void destroyApp(boolean var1) {
  135.    }
  136.  
  137.    public void commandAction(Command var1, Displayable var2) {
  138.       if (var2 == this.field_4) {
  139.          if (var1 == field_13) {
  140.             field_2[0] = (byte)(this.field_6.isSelected(0) ? 1 : 0);
  141.             boolean var3 = this.field_5.isSelected(0);
  142.             byte var4;
  143.             if (var3 && this.field_5.isSelected(1)) {
  144.                var4 = 2;
  145.             } else if (var3) {
  146.                var4 = 0;
  147.             } else {
  148.                var4 = 1;
  149.             }
  150.  
  151.             field_2[2] = (byte)var4;
  152.             field_2[3] = (byte)(this.field_7.isSelected(0) ? 1 : 0);
  153.  
  154.             try {
  155.                int var5 = Integer.parseInt(this.field_8.getString());
  156.                if (var5 > 0) {
  157.                   field_2[1] = (byte)var5;
  158.                } else {
  159.                   field_2[1] = 10;
  160.                }
  161.             } catch (Exception var6) {
  162.                field_2[1] = 10;
  163.             }
  164.  
  165.             method_2();
  166.          }
  167.  
  168.          field_11.setCurrent(field_1);
  169.       } else if (var1 == field_14) {
  170.          this.destroyApp(false);
  171.          ((MIDlet)this).notifyDestroyed();
  172.       } else if (var1 == field_13) {
  173.          field_11.setCurrent(field_1);
  174.       } else if (var1 == field_15 || var1 == List.SELECT_COMMAND) {
  175.          int var7 = field_1.getSelectedIndex();
  176.          if (var7 == 3) {
  177.             new ac(false, field_1);
  178.          } else if (var7 == 2) {
  179.             new ac(true, field_1);
  180.          } else if (var7 == 4) {
  181.             field_31.a(this, field_1);
  182.             field_11.setCurrent(field_31);
  183.             field_31.c("reqwireless.com/ev-1.2/");
  184.          } else if (var7 == 7) {
  185.             field_31.a(this, field_1);
  186.             field_11.setCurrent(field_31);
  187.             field_31.c("reqwireless.com/reg.html");
  188.          } else if (var7 == 5) {
  189.             field_31.a(this, field_1);
  190.             field_11.setCurrent(field_31);
  191.             field_31.a("reqwireless.com/ev-1.2/guide/", (String)null, (String)null, new q[]{new q("A", field_31.getKeyName(field_31.getKeyCode(9))), new q("D", field_31.getKeyName(field_31.getKeyCode(12)))}, "UTF-8");
  192.          } else if (var7 == 6) {
  193.             this.field_4 = new Form("Settings");
  194.             this.field_4.addCommand(field_12);
  195.             this.field_4.addCommand(field_13);
  196.             this.field_6 = new ChoiceGroup("Images", 2);
  197.             this.field_6.append("Enable images", (Image)null);
  198.             this.field_6.setSelectedIndex(0, method_1(0) == 1);
  199.             this.field_4.append(this.field_6);
  200.             this.field_7 = new ChoiceGroup("Font display", 2);
  201.             this.field_7.append("Use small fonts", (Image)null);
  202.             this.field_7.setSelectedIndex(0, method_1(3) == 1);
  203.             this.field_4.append(this.field_7);
  204.             this.field_5 = new ChoiceGroup("Header display", 2);
  205.             this.field_5.append("From:", (Image)null);
  206.             this.field_5.append("Subject:", (Image)null);
  207.             byte var8 = method_1(2);
  208.             if (var8 == 0 || var8 == 2) {
  209.                this.field_5.setSelectedIndex(0, true);
  210.             }
  211.  
  212.             if (var8 == 1 || var8 == 2) {
  213.                this.field_5.setSelectedIndex(1, true);
  214.             }
  215.  
  216.             this.field_4.append(this.field_5);
  217.             this.field_8 = new TextField("Messages per display: ", "" + method_1(1), 6, 2);
  218.             this.field_4.append(this.field_8);
  219.             this.field_4.setCommandListener(this);
  220.             field_11.setCurrent(this.field_4);
  221.          } else if (var7 == 1) {
  222.             field_31.a((CommandListener)null, (Displayable)null);
  223.             new l(field_1, (a)null, field_1);
  224.          } else if (var7 == 0) {
  225.             new h(field_1);
  226.          }
  227.       }
  228.  
  229.    }
  230.  
  231.    // $FF: renamed from: b () void
  232.    private static void method_0() {
  233.       if (field_10 != null) {
  234.          field_10.destroy();
  235.          field_10 = null;
  236.       }
  237.  
  238.       if (field_9 != null) {
  239.          try {
  240.             field_9.closeRecordStore();
  241.          } catch (Exception var1) {
  242.          }
  243.  
  244.          field_9 = null;
  245.       }
  246.  
  247.    }
  248.  
  249.    // $FF: renamed from: a (int) byte
  250.    public static byte method_1(int param0) {
  251.       // $FF: Couldn't be decompiled
  252.    }
  253.  
  254.    // $FF: renamed from: a () void
  255.    private static void method_2() {
  256.       try {
  257.          field_9 = RecordStore.openRecordStore("Settings", true);
  258.          field_10 = field_9.enumerateRecords((RecordFilter)null, (RecordComparator)null, false);
  259.          if (field_10.hasNextElement()) {
  260.             field_9.deleteRecord(field_10.nextRecordId());
  261.          }
  262.  
  263.          field_9.addRecord(field_2, 0, field_2.length);
  264.       } catch (Exception var5) {
  265.       } finally {
  266.          method_0();
  267.       }
  268.  
  269.    }
  270. }
  271.